package com.ougy.reshop.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;


@Entity
public class Complaint {
	private int id;
	
	private User from_user;
	private User to_user;
	private String type;
	private int status;
	
	
	private List<ComplaintGoods> cgd=new ArrayList<ComplaintGoods>();
	
	private ComplaintSubject cs;
	private String from_user_content;
	private String to_user_content;
	private Date appeal_time;
	
	private String handler_content;
	private Date handler_time;
	private User handler_user;
	
	private String talk_content;
	
	private Accessory from_acc1;
	private Accessory from_acc2;
	private Accessory from_acc3;
	private Accessory to_acc1;
	private Accessory to_acc2;
	private Accessory to_acc3;

	@OneToOne
	public Accessory getTo_acc1() {
		return to_acc1;
	}

	public void setTo_acc1(Accessory to_acc1) {
		this.to_acc1 = to_acc1;
	}
	@OneToOne
	public Accessory getTo_acc2() {
		return to_acc2;
	}

	public void setTo_acc2(Accessory to_acc2) {
		this.to_acc2 = to_acc2;
	}
	@OneToOne
	public Accessory getTo_acc3() {
		return to_acc3;
	}

	public void setTo_acc3(Accessory to_acc3) {
		this.to_acc3 = to_acc3;
	}
	@OneToOne
	public Accessory getFrom_acc1() {
		return from_acc1;
	}

	public void setFrom_acc1(Accessory from_acc1) {
		this.from_acc1 = from_acc1;
	}
	@OneToOne
	public Accessory getFrom_acc2() {
		return from_acc2;
	}

	public void setFrom_acc2(Accessory from_acc2) {
		this.from_acc2 = from_acc2;
	}
	@OneToOne
	public Accessory getFrom_acc3() {
		return from_acc3;
	}

	public void setFrom_acc3(Accessory from_acc3) {
		this.from_acc3 = from_acc3;
	}

	@Id @GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne
	public User getFrom_user() {
		return from_user;
	}

	public void setFrom_user(User from_user) {
		this.from_user = from_user;
	}

	@ManyToOne
	public User getTo_user() {
		return to_user;
	}

	public void setTo_user(User to_user) {
		this.to_user = to_user;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	@OneToMany(mappedBy="complaint",cascade={CascadeType.ALL})
	public List<ComplaintGoods> getCgd() {
		return cgd;
	}

	public void setCgd(List<ComplaintGoods> cgd) {
		this.cgd = cgd;
	}
	@ManyToOne
	public ComplaintSubject getCs() {
		return cs;
	}

	public void setCs(ComplaintSubject cs) {
		this.cs = cs;
	}
	@Column(columnDefinition="LongText")
	public String getTo_user_content() {
		return to_user_content;
	}

	public void setTo_user_content(String to_user_content) {
		this.to_user_content = to_user_content;
	}

	public Date getAppeal_time() {
		return appeal_time;
	}

	public void setAppeal_time(Date appeal_time) {
		this.appeal_time = appeal_time;
	}

	@Column(columnDefinition="LongText")
	public String getHandler_content() {
		return handler_content;
	}

	public void setHandler_content(String handler_content) {
		this.handler_content = handler_content;
	}

	public Date getHandler_time() {
		return handler_time;
	}

	public void setHandler_time(Date handler_time) {
		this.handler_time = handler_time;
	}

	@ManyToOne
	public User getHandler_user() {
		return handler_user;
	}

	public void setHandler_user(User handler_user) {
		this.handler_user = handler_user;
	}
	@Column(columnDefinition="LongText")
	public String getTalk_content() {
		return talk_content;
	}

	public void setTalk_content(String talk_content) {
		this.talk_content = talk_content;
	}
	@Column(columnDefinition="LongText")
	public String getFrom_user_content() {
		return from_user_content;
	}

	public void setFrom_user_content(String from_user_content) {
		this.from_user_content = from_user_content;
	}
	
	
	
	
	
	
}
